package internal;

import java.util.Date;

public class UserJwt {

    Date issuedAt;
    Date expiration;
    String userId;
    String jwtVersion;

    boolean isEffective;
    String invalidReason;

    private UserJwt(String invalidReason) {
        this.invalidReason = invalidReason;
    }


    public UserJwt(String userId, String jwtVersion, Date issuedAt, Date expiration) {
        this.issuedAt = issuedAt;
        this.expiration = expiration;
        this.userId = userId;
        this.jwtVersion = jwtVersion;
        this.isEffective = true;
    }

    public static UserJwt createFailJwt(String invalidReason) {
        return new UserJwt(invalidReason);
    }


    public Date getIssuedAt() {
        return issuedAt;
    }

    public Date getExpiration() {
        return expiration;
    }

    public String getUserId() {
        return userId;
    }

    public String getJwtVersion() {
        return jwtVersion;
    }

    public boolean isEffective() {
        return isEffective;
    }

    public String getInvalidReason() {
        return invalidReason;
    }
}
